package com.erp.controller;

import com.erp.entity.User;
import com.erp.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

//    添加示例：
    @PostMapping("/add")
    public void add(@RequestBody User user){
        userService.add(user);
    }
}
